package com.quantum.mvc.event
{

	import flash.events.Event;

	public class CommandCompletionEvent extends Event
	{
		/**
		 * The original request event that this event is a response of.
		 */
		[Request]
		public var request:Event;

		/**
		 * The result of a command.
		 */
		[Result]
		public var result:Object;

		/**
		 * The error resulting from a command, if any.
		 */
		[Error]
		public var error:Error;

		/**
		 * Initializes an instance of this class.
		 *
		 * @param type
		 *  The id for the event.
		 */
		public function CommandCompletionEvent(type:String)
		{
			super(type);
		}

		/**
		 * Creates a clone of this event. All custom events should override this method.
		 *
		 * @return
		 *  A clone of this event.
		 */
		public override function clone():Event
		{
			var event:CommandCompletionEvent=new CommandCompletionEvent(type);

			event.result=result;
			event.error=error;
			event.request=request;

			return event;
		}
	}

}